SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

CREATE PROCEDURE dbo.[DnnProduct_GetPropertyDefinitionsByPortal] 
	@PortalID	int
AS
	SELECT	dbo.DnnProduct_ProfilePropertyDefinition.*
	FROM	dbo.DnnProduct_ProfilePropertyDefinition
	WHERE  (PortalId = @PortalID OR (PortalId IS NULL AND @PortalID IS NULL))		
	ORDER BY ViewOrder
GO
